home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / utilitys / 9 / edit_spr.doc < prev    next >
Encoding:
Text File  |  1985-11-19  |  4.7 KB  |  97 lines

  1.      INTRODUCTION
  2.  
  3.      If you have been saying to yourself 'this computer is great!
  4. Look  what  I can do with this Neochrome!  But alas ( heavy sigh ),
  5. I  wish I had access to sprites .',  then this program is for you. 
  6. It is a raster sprite generator.  That means that it makes sprites 
  7. that can be any size or shape and have as many number of colors as 
  8. the  rest  of your screen.  The basic idea is that you use  either 
  9. Neochrome  or Degas to design your sprites.  Leave plenty of blank 
  10. space  around  them.  Then call up this program.  It will give you 
  11. some  simple instructions and then prompt you for a  filename.  It 
  12. will  display  your  choice without using the  new  color  palette 
  13. information. This means that you will have to reserve some palette 
  14. positions  for your sprites when you design your  background.  You 
  15. are limited to 16 colors in any case (lo-res).  Run the mouse over 
  16. to  your  sprite and 'drag' the left button to  form  a  rubberbox 
  17. around it.  You will then be asked to name it. Once it has a name, 
  18. the program will build and display a black and white mask for  it. 
  19. What actually gets saved to the disk is as follows:
  20.  
  21.                         2 bytes   height
  22.                         2 bytes   width ( in 4 bytes units )
  23.                         x bytes   sprite data
  24.                         x bytes   mask data
  25.                 ,where 'x' equals the WIDTH * 4 * HEIGHT
  26.  
  27.      You  can see what you have done by pressing the  right  mouse 
  28. button.  This invokes the demo routine.  Press any key to get back 
  29. into the edit mode. Once in the edit mode, you may  exit the program
  30. by pressing both mouse buttons simultaniously.
  31.  
  32.      A QUICK WORD ABOUT MASKS
  33.  
  34.      Normally you would not need this mask.  One assumes that most 
  35. people will want to use the standard copy raster routine (vro_cpyfm).
  36. However, on those rare occasions when you want to avoid GEM ( or
  37. weren't given the choice-I can think of several Forth examples. )
  38. you can use these sprites with their masks.  For your convenience, 
  39. this is what I have done in this demo. These sprites are cut along
  40. 4  word ( 8 bytes ) boundaries.  This means that you can avoid bit 
  41. shifting if you want to and don't mind the positional  limitations 
  42. this implies.
  43.      So  how would one use these things?  Well there are at  least 
  44. three  ways.  First,  you  could  simply copy the sprite  data  to 
  45. somewhere  on  the  screen.  This,  unfortunately,  leaves a large 
  46. rectangular hole in your background with the sprite resting in the 
  47. middle. This is okay, if your background is black. The second way, 
  48. is  to 'OR' each bit of the sprite with each corresponding bit  of 
  49. the  background.  This gets rid of the insidious black  rectangle. 
  50. But  it  does  strange things to the colors of  the  sprite.  This 
  51. effect  will  be of interest to people who want to  have  'ghosts' 
  52. that walk through walls.  The third way is to 'AND' the background 
  53. with the mask first. This creats a hole into which the sprite will 
  54. exactly fit when it gets 'OR'-ed with this product.
  55.  
  56.      THE CODE
  57.  
  58.      I have tryed to make this program as useful to the  scavenger 
  59. as  possible.  Many of these routines can be copyed whole or  with 
  60. slight  modifications  into your personal  libraries.  This  keeps 
  61. future code short and easier to write. With Haba Hippo C this is
  62. especially important. Even more so if you are working with half a 
  63. meg  of memory.
  64.  
  65.      A  COPY  OF THE C SOURCE CODE FOR THIS  PROGRAM  AND  SEVERAL 
  66. OTHER USEFUL ROUTINES AND PROGRAMS ARE AVAILABLE FOR $15 AND  YOUR 
  67. RETURN  ADDRESS.($10 if you send your own disk.)You will have your
  68. copy  within one week of the time I get your letter. ( You will
  69. also be on my mailing list for new programs in Megamax C and maybe
  70. Forth.)
  71.  
  72.      Send to:
  73.  
  74.           PETER BEERY               /* This address is good    */
  75.           DEPT. OF PHYSICS          /* year round. So don't    */
  76.           UNIVERSITY OF NOTRE DAME  /* about the end of school */
  77.           NOTRE DAME, INDIANA       /* year.      -PDB  5/1/86 */
  78.                          46556
  79.  
  80.  
  81.  
  82.      GENERAL HABA HIPPO HINTS
  83.  
  84.   If you have trouble getting a program to compile,  then 
  85. try the following. Break the code into several pieces and compile
  86. each seperately.  Then link them together as the last step. If you 
  87. still are having trouble, then 'rename' the .acc part of your desk 
  88. accessories to .acx and reboot your system.  This frees memory for 
  89. the  compiler.  If you have the one megabyte upgrade or if you own 
  90. the 1040 ST then things will compile MUCH faster if you copy  your 
  91. haba  hippo disk into a ramdisk and run from there.  I  personally 
  92. don't know how I would survive without a ramdisk.( a factor of ten 
  93. in speed at least!)
  94.  
  95.      the end.
  96.